home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)G / (A)G6.ADF / terminator < prev    next >
Text File  |  1988-05-24  |  3KB  |  194 lines

  1.  
  2. equate flaga 9
  3. equate ndist 8
  4. equate ygoto 7
  5. equate xgoto 6
  6. equate count 5
  7. equate scinc 4
  8. equate scang 3
  9.  
  10. cpu 2x16bit
  11. drive track 30
  12. weapon crail  90 50
  13. weapon laser  80 50
  14. weapon crail  90 50
  15. reg 10
  16.  
  17. # 0 sto 3
  18. # 0 sto count
  19.  
  20. # 100 sto xgoto
  21. # 50 posx x>y? goto abl1
  22. # 0 sto xgoto
  23. label abl1
  24. # 100 sto ygoto
  25. # 50 posy x>y? goto abl2
  26. # 0 sto ygoto
  27. label abl2
  28.  
  29.  
  30. rcl ygoto # 50 - rcl xgoto # 50 - /
  31. x<0? goto abl3
  32. # 90 sto+ count
  33. label abl3
  34. rcl xgoto x=0? goto abl4
  35. # 180 sto+ count
  36. label abl4
  37.  
  38. rcl count
  39.  
  40. label top             \ go to top left corner \
  41. rcl ygoto posy - sto 1
  42. rcl xgoto posx - sto 2
  43. atan2 heading
  44. rcl 1 enter *
  45. rcl 2 enter *
  46. + sqrt
  47. # 2 /
  48. speed
  49. # 3 x<y? goto top
  50.  
  51.  
  52. # 0 speed            \ stop at corner \
  53.  
  54. label begin
  55. # 140 sto scinc
  56. rcl count # 135 + sto scang
  57. gosub nuke
  58. # 2
  59. rcl flaga x=y? goto donow
  60. x!=0? goto begin
  61.  
  62. hit
  63. # -4 sto scinc
  64. rcl count sto scang
  65.  
  66. label scan                     \ scan around at corner for some commies \
  67. hit x>0? goto runaway
  68. # 2 rcl scang radar
  69. x>0? goto fire
  70. rcl scinc sto- scang
  71. rcl scang rcl count # 90 - x>y? goto turn
  72. rdn
  73. rcl count x<y? goto turn
  74. goto scan
  75.  
  76.  
  77. label turn
  78. # -1 sto* scinc
  79. goto scan
  80.  
  81.  
  82. label fire
  83. sto 0
  84. rcl scang rcl scinc # 2 / - aim
  85. rcl 0
  86. fire 0 fire 1 fire 2
  87. goto scan
  88.  
  89.  
  90. label runaway
  91. # 180 rcl count + sto scang
  92. # 90 sto scinc gosub nuke
  93. # 2
  94. rcl flaga x=y? goto donow
  95. x!=0? goto runaway
  96.  
  97. label donow
  98. # 90 sto+ count
  99. rcl count # 350 x>y? goto jup1
  100. # 360 sto- count
  101. label jup1
  102.  
  103. label moveon
  104. rcl count # 180 + heading
  105. # 0    
  106. rcl count # 90 - sto scang
  107. radar x>0? goto fire2
  108.  
  109. rcl count # 80 x<y? goto jup2
  110. posx # 2 / speed
  111. # 3 x<y? goto moveon
  112. goto enough
  113.  
  114. label jup2
  115. rdn # 170 x<y? goto jup3
  116. posy # 2 / speed
  117. # 3 x<y? goto moveon
  118. goto enough
  119.  
  120. label jup3
  121. rdn # 260 x<y? goto jup4
  122. # 100 posx - # 2 / speed
  123. # 3 x<y? goto moveon
  124. goto enough
  125.  
  126. label jup4
  127. # 100 posy - # 2 / speed
  128. # 3 x<y? goto moveon
  129. goto enough
  130.  
  131.  
  132. label enough
  133. # 0 speed
  134. goto begin
  135.  
  136. label fire2
  137. rcl scang aim
  138. rdn
  139. fire 0 
  140. goto moveon
  141.  
  142.  
  143. label nuke             \ flaga: 0: nothing there \
  144. hit
  145. # 0 sto flaga        \        1: found something \
  146.                      \        2: got hit while here \
  147. label nucked
  148. hit x=0? goto objk
  149. # 2 sto flaga
  150. return
  151. label objk
  152.  
  153. rcl scinc         \ recall the beam width \     \ start=pi/2 \
  154. rcl scang         \ recall the scan angle \     \ start=pi/2 \
  155. radar         \ anyone out there? \
  156. x>0?          \ found something \
  157. sto ndist         \ store distance \
  158. x>0?
  159. goto sam
  160. rcl flaga x=0? return
  161. rcl scinc
  162. # 2 *                    
  163. sto+ scang        \ add it \
  164.  
  165. label sam           \ found something \
  166. # 1 sto flaga
  167. # 2
  168. sto/ scinc        \ half the beam width \
  169. rcl scinc
  170. sto- scang        \ take new width from scan angle \
  171. # .3
  172. x<y?              \ if width is less than .3, start firing. \
  173. goto nucked
  174.  
  175. # 2
  176. rcl ndist / atan
  177. rcl scang + aim
  178.  
  179. label fire3
  180. hit
  181. x!=0? 
  182. goto runaway
  183. rcl ndist
  184. fire 0
  185. fire 1
  186. fire 2
  187. # .4              \ beam width is put in x \
  188. rcl scang         \ rcl pushes stack up, so beam width is now in y, and \
  189.                   \ recalled number is in x \
  190. radar             \ is it still there ? \
  191. x<0? goto begin   \ not there \
  192. goto fire3        \ otherwise keep firing \
  193.  
  194.